﻿using FSUIPC;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;

namespace SimWithP3d
{
    /// <summary>
    /// 注释：这个Cs没有调用到
    /// </summary>
    class FSUIPC_offset
    {
        public static AITrafficServices AI;

        #region Fuel Tank Setting Offset  _p 百分比  _v最大容量
        static public Offset<int> Centre_p = new Offset<int>(0x0b74);
        static public Offset<int> Centre_v = new Offset<int>(0x0b78);

        static public Offset<int> Centre2_p = new Offset<int>(0x1244);
        static public Offset<int> Centre2_v = new Offset<int>(0x1248);

        static public Offset<int> Centre3_p = new Offset<int>(0x124c);
        static public Offset<int> Centre3_v = new Offset<int>(0x1250);

        static public Offset<int> Leftmain_p = new Offset<int>(0x0b7c);
        static public Offset<int> Leftmain_v = new Offset<int>(0x0b80);

        static public Offset<int> Leftaux_p = new Offset<int>(0x0b84);
        static public Offset<int> Leftaux_v = new Offset<int>(0x0b88);

        static public Offset<int> Lefttip_p = new Offset<int>(0x0b8C);
        static public Offset<int> Lefttip_v = new Offset<int>(0x0b90);

        static public Offset<int> Rightmain_p = new Offset<int>(0x0b94);
        static public Offset<int> Rightmain_v = new Offset<int>(0x0b98);

        static public Offset<int> Rightaux_p = new Offset<int>(0x0b9c);
        static public Offset<int> Rightaux_v = new Offset<int>(0x0ba0);

        static public Offset<int> Righttip_p = new Offset<int>(0x0ba4);
        static public Offset<int> Righttip_v = new Offset<int>(0x0ba8);

        static public Offset<int> External1_p = new Offset<int>(0x1254);
        static public Offset<int> External1_v = new Offset<int>(0x1258);

        static public Offset<int> External2_p = new Offset<int>(0x125C);
        static public Offset<int> External2_v = new Offset<int>(0x1260);

        static public Offset<int> EmptyWeight = new Offset<int>(0x1330);   //  value/256 = value
        static public Offset<int> ZeroFuelWeight = new Offset<int>(0x3BFC); // value/256 = tvalue
        static public Offset<short> FuelWeight = new Offset<short>(0x126C); //  /256;

        static public Offset<string> WEATHER = new Offset<string>(0xB800, 1024);
        static public Offset<string> Weatherset = new Offset<string>(0xB000, 2048);
        #endregion

        #region Failure Setting Offset

        #region Engines Failures        
        public static Offset<BitArray> Engine_fail_Offset = new Offset<BitArray>("ENGINE_FAIL", 0x0B6B, 1);       //Engine bit0 Eng1, bit1 Eng2, bit2 Eng3, bit3 Eng4
        public static Offset<BitArray> Engine_Fire_offset = new Offset<BitArray>("ENGINE_FIRE", 0x3366, 1);      //Engine fire tag, bit0 Eng1, bit1 Eng2, bit2 Eng3, bit3 Eng4
        #endregion

        #region//condition
        public static Offset<int> AIRSPEED = new Offset<int>("CONDITION", 0x02BC);//空速表
        public static Offset<int> ALTIMETER = new Offset<int>("CONDITION", 0x0574);//高度表
        #endregion

        #region Gauge Failures
        public static Offset<byte> ASIgauge = new Offset<byte>("GAUGE", 0x0B65);     //Airspeed Indicator gauge
        public static Offset<byte> ALTgauge = new Offset<byte>("GAUGE", 0x0B66);     //Altimeter gauge
        public static Offset<byte> AIgauge = new Offset<byte>("GAUGE", 0x0B67);      //Attitude Indicator gauge
        public static Offset<byte> VSIgauge = new Offset<byte>("GAUGE", 0x0B6E);         //Verticalspeed Indicator gauge
        public static Offset<byte> Maggauge = new Offset<byte>("GAUGE", 0x0B69);          //MagCompass
        public static Offset<byte> DirectionInd = new Offset<byte>("GAUGE", 0x0B6D);    //Direction indicator
        public static Offset<byte> Turngauge = new Offset<byte>("GAUGE", 0x0B72);        //Turn coordinator gauge
        #endregion

        #region System Failures  ---------------failure = 1 ,0 OK.
        public static Offset<int> GeneratorENG1 = new Offset<int>("SYSTEM", 0x3B78);      //ENG1 Generator  0 failure, 1 OK
        public static Offset<int> GeneratorENG2 = new Offset<int>("SYSTEM", 0x3ABC8);      //ENG2 Generator  0 failure, 1 OK
        public static Offset<int> GeneratorENG3 = new Offset<int>("SYSTEM", 0x39F8);      //ENG3 Generator  0 failure, 1 OK
        public static Offset<int> GeneratorENG4 = new Offset<int>("SYSTEM", 0x3938);      //ENG4 Generator  0 failure, 1 OK
        public static Offset<byte> Hydraulic = new Offset<byte>("SYSTEM", 0x0B62);        //Hydraulics failure
        public static Offset<byte> Electrical = new Offset<byte>("SYSTEM", 0x0B6A);             //Electrics
        public static Offset<byte> Vacuumgauge = new Offset<byte>("SYSTEM", 0x0B73);      //Vacuum gauge
        public static Offset<byte> Pitot = new Offset<byte>("SYSTEM", 0x0B71);            //Pitot inoperable
        #endregion

        #region FUEL Failure
        //    public static Offset<byte> FuelInd = new Offset<byte>("FUEL", 0x0B6C);      //Fuel indicators
        public static Offset<int> left_Main = new Offset<int>("FUEL", 0x0B7C);//left main tank 
        public static Offset<int> left_Main_total = new Offset<int>("FUEL", 0x0B80);//left main tank total
        public static Offset<int> left_Aux = new Offset<int>("FUEL", 0x0B84);//left aux tank
        public static Offset<int> left_Aux_total = new Offset<int>("FUEL", 0x0B88);//left aux tank total
        public static Offset<int> Left_Wing_Tip = new Offset<int>("FUEL", 0x0B8C);//Left_Wing_Tip tank
        public static Offset<int> Left_Wing_Tip_total = new Offset<int>("FUEL", 0x0B90);//Left_Wing_Tip tank total
        public static Offset<int> center1 = new Offset<int>("FUEL", 0x0B74);//center1 tank
        public static Offset<int> center1_total = new Offset<int>("FUEL", 0x0B78);//center1 tank total
        public static Offset<int> center2 = new Offset<int>("FUEL", 0x1244);//center2 tank
        public static Offset<int> center2_total = new Offset<int>("FUEL", 0x1248);//center2 tank total
        public static Offset<int> center3 = new Offset<int>("FUEL", 0x124C);//center3 tank
        public static Offset<int> center3_total = new Offset<int>("FUEL", 0x1250);//center3 tank total
        public static Offset<int> right_Main = new Offset<int>("FUEL", 0x0B94);//right main tank 
        public static Offset<int> right_Main_total = new Offset<int>("FUEL", 0x0B98);//right main tank total
        public static Offset<int> right_Aux = new Offset<int>("FUEL", 0x0B9C);//right aux tank
        public static Offset<int> right_Aux_total = new Offset<int>("FUEL", 0x0BA0);//right aux tank total
        public static Offset<int> right_Wing_Tip = new Offset<int>("FUEL", 0x0BA4);//right_Wing_Tip tank
        public static Offset<int> right_Wing_Tip_total = new Offset<int>("FUEL", 0x0BA8);//right_Wing_Tip tank total
        public static Offset<int> external1 = new Offset<int>("FUEL", 0x1254);//external 1  tank
        public static Offset<int> external1_total = new Offset<int>("FUEL", 0x1258);//external 1  tank total
        public static Offset<int> external2 = new Offset<int>("FUEL", 0x125C);//external 2  tank
        public static Offset<int> external2_total = new Offset<int>("FUEL", 0x1260);//external 2  tank total

        #endregion

        #region Gear&Flap Failure
        public static Offset<int> Gear = new Offset<int>("GEAR", 0x0BE8);//Gear Up --0  own--16383
        public static Offset<int> Flaps = new Offset<int>("FLAPS", 0x0BDC);//FLap Position 0、1、2、3  0 ，4096、 8192 、 16384
        #endregion


        #endregion

        static public Offset<short> EngineNumber = new Offset<short>(0x0AEC);
        static public Offset<short> Stormlayer = new Offset<short>(0x0F8A);

        #region Time and Season Setting
        static public Offset<byte> Timeofday = new Offset<byte>(0x115E);        //dawn day dusk night 0123;             lose efficacy
        static public Offset<byte> HourSim = new Offset<byte>(0x0238);          //Hour of local time in SIM
        static public Offset<byte> MinSim = new Offset<byte>(0x0239);           //Minute of local time in SIM
        static public Offset<byte> SecSim = new Offset<byte>(0x023A);           //Second of local time in SIM           lose efficacy
        static public Offset<short> YearSim = new Offset<short>(0x024A);        //Year of local time in SIM             lose efficacy
        static public Offset<byte> MonSim = new Offset<byte>(0x0244);           //Month of local time in SIM            lose efficacy
        static public Offset<byte> DaySim = new Offset<byte>(0x0245);           //Day of local time in SIM              lose efficacy
        static public Offset<short> DayNumber = new Offset<short>(0x023E);
        static public Offset<short> YearNumber = new Offset<short>(0x0240);
        static public Offset<short> Season = new Offset<short>(0x0248);         //Winter Spring Summer Fall, 0123       lose efficacy
        #endregion

        #region Weather Setting
        static public Offset<short> Precipitation = new Offset<short>(0x04D2);          //hi-byte 0-2,none, rain, snow   low-byte 0-5 rate
                                                                                        //static public Offset<byte> Cloudtype = new Offset<byte>(0x0E84);
                                                                                        //static public Offset<byte> CloudCover = new Offset<byte>(0x0E85);

        //cover : 65535 = 8 oktas , 32768 = 4 oktas, 0= clear;
        //type :  0  = userDefined , 1= cirrus , 8 = stratus, 9 = cumulus;
        //turb : 0 none, 64, 128, 192, 255 worst;

        static public Offset<short> UpperCloudceil = new Offset<short>(0x0F1C);
        static public Offset<short> UpperCloudbase = new Offset<short>(0x0F1E);
        static public Offset<ushort> UpperCloudcover = new Offset<ushort>(0x0F20);
        static public Offset<short> UpperCloudalt = new Offset<short>(0x0F22);
        static public Offset<short> UpperCloudtype = new Offset<short>(0x0F7A);
        static public Offset<short> UpperCloudice = new Offset<short>(0x0F7C);
        static public Offset<short> UpperCloudturb = new Offset<short>(0x0F7E); //  0-255 , 0,64,128,192,255

        static public Offset<short> LowerCloudceil = new Offset<short>(0x0F24);
        static public Offset<short> LowerCloudbase = new Offset<short>(0x0F26);
        static public Offset<ushort> LowerCloudcover = new Offset<ushort>(0x0F28);
        static public Offset<short> LowerCloudalt = new Offset<short>(0x0F2A);
        static public Offset<short> LowerCloudtype = new Offset<short>(0x0F80);
        static public Offset<short> LowerCloudice = new Offset<short>(0x0F82);
        static public Offset<short> LowerCloudturb = new Offset<short>(0x0F84);

        static public Offset<short> Stormceil = new Offset<short>(0x0F2C);
        static public Offset<short> Stormbase = new Offset<short>(0x0F2E);
        static public Offset<ushort> Stormcover = new Offset<ushort>(0x0F30);
        static public Offset<short> Stormalt = new Offset<short>(0x0F32);
        static public Offset<short> Stormtype = new Offset<short>(0x0F86);
        static public Offset<short> Stormice = new Offset<short>(0x0F88);
        static public Offset<short> Stormturb = new Offset<short>(0x0F8A);

        public static Offset<short> Visiblity = new Offset<short>(0x0F8C);                  //可视距离  /100 = value

        static public Offset<short> UpperWindceil = new Offset<short>(0x0F4C);
        static public Offset<short> UpperWindbase = new Offset<short>(0x0F4E);
        static public Offset<short> UpperWindspeed = new Offset<short>(0x0F50);
        static public Offset<short> UpperWinddirect = new Offset<short>(0x0F52);            //*360/65536 = value
        static public Offset<short> UpperWindturb = new Offset<short>(0x0F54);
        static public Offset<short> UpperWindgust = new Offset<short>(0x0F56);

        static public Offset<short> MiddleWindceil = new Offset<short>(0x0F58);
        static public Offset<short> MiddleWindbase = new Offset<short>(0x0F5A);
        static public Offset<short> MiddleWindspeed = new Offset<short>(0x0F5C);
        static public Offset<short> MiddleWinddirect = new Offset<short>(0x0F5E);
        static public Offset<short> MiddleWindturb = new Offset<short>(0x0F60);
        static public Offset<short> MiddleWindgust = new Offset<short>(0x0F62);

        static public Offset<short> LowerWindceil = new Offset<short>(0x0F64);
        static public Offset<short> LowerWindbase = new Offset<short>(0x0F66);
        static public Offset<short> LowerWindspeed = new Offset<short>(0x0F68);
        static public Offset<short> LowerWinddirect = new Offset<short>(0x0F6A);
        static public Offset<short> LowerWindturb = new Offset<short>(0x0F6C);
        static public Offset<short> LowerWindgust = new Offset<short>(0x0F6E);

        static public Offset<short> SurfaceWindceil = new Offset<short>(0x0F70);
        static public Offset<short> SurfaceWindspeed = new Offset<short>(0x0F72);
        static public Offset<short> SurfaceWinddirect = new Offset<short>(0x0F74);
        static public Offset<short> SurfaceWindturb = new Offset<short>(0x0F76);
        static public Offset<short> SurfaceWindgust = new Offset<short>(0x0F78);


        //static public Offset<short> LowerCloudtype = new Offset<short>(0x0F80);
        //static public Offset<short> LowerCloudicy = new Offset<short>(0x0FF82);
        //static public Offset<short> LowerCloudturb = new Offset<short>(0x0F84);

        //static public Offset<short> LowerWindceil = new Offset<short>(0x0F64);
        //static public Offset<short> LowerWindbase = new Offset<short>(0x0F66);
        //static public Offset<short> LowerWindspeed = new Offset<short>(0x0f68);
        //static public Offset<short> LowerWinddire = new Offset<short>(0x0f6A);
        //static public Offset<short> LowerWindturb = new Offset<short>(0x0F6C);
        #endregion

        #region Location Setting
        public static Offset<int> sendControl = new Offset<int>(0x3110, true); // 演示移动飞机


        public static Offset<short> SlewRoll = new Offset<short>(0x05E4);
        public static Offset<short> SlewYaw = new Offset<short>(0x05E6);
        public static Offset<short> SlewPitch = new Offset<short>(0x05EE);
        public static Offset<short> SlewUp = new Offset<short>(0x05E8);
        public static Offset<short> SlewForward = new Offset<short>(0x05EB);
        public static Offset<short> SlewLeft = new Offset<short>(0x05ED);

        public static Offset<short> Crashed_Flag = new Offset<short>("CRASH", 0x0840);//坠毁标志 1=坠毁
        public static Offset<long> Latitude = new Offset<long>(0x0560);
        public static Offset<long> Longitude = new Offset<long>(0x0568);
        public static Offset<int> Altitude = new Offset<int>(0x0574);                       //飞机高度
        public static Offset<int> Pushback = new Offset<int>(0x31F4);                       //推出 0 back 1 left  2 right 3 off
        public static Offset<int> Heading = new Offset<int>(0x0580);
        public static Offset<int> Bank = new Offset<int>(0x057C);               //  *360/65536/65536 = value
        public static Offset<int> Pitch = new Offset<int>(0x0578);
        public static Offset<int> Speed = new Offset<int>(0x0558);
        public static Offset<short> Aoa = new Offset<short>(0x11BE);            //Angle of attack

        public static Offset<int> TAS = new Offset<int>("map",0x02B8,false);                //  /128 = value
        public static Offset<int> IAS = new Offset<int>("map",0x02BC,false);                //  /128 = value
        public static Offset<int> VS = new Offset<int>("map",0x02C8,false);                 //  /256 = value (m/s)    *60*3.28084/256 = value(ft/min)
        public static Offset<double> GForce = new Offset<double>("map",0x1140,false);       //  /624 
        public static Offset<int> pres_ALTIMETER_map= new Offset<int>("map", 0x3324,false);//气压高度表，用于高度表示数
        #endregion

        #region airplane properties DATA
        //   public static Offset<int> FlapAdd = new Offset<int>(0X0BDC);

        public static Offset<double> XAcc = new Offset<double>("PLC", 0x3060);  //ACCELERATION BODY X  Feet per second squared    //ft/sec/sec
        public static Offset<double> YAcc = new Offset<double>("PLC", 0x3068);//ACCELERATION BODY Y 
        public static Offset<double> ZAcc = new Offset<double>("PLC", 0x3070);// ACCELERATION BODY Z 

        public static Offset<double> PitchAcc = new Offset<double>("PLC1", 0x3078,false);     //radians/sec/sec
        public static Offset<double> RollAcc = new Offset<double>("PLC1", 0x3080,false);
        public static Offset<double> YawAcc = new Offset<double>("PLC1", 0x3088,false);

        //public static Offset<double> ZV = new Offset<double>(0x3090);           //ft/sec
        //public static Offset<double> XV = new Offset<double>(0x3098);
        //public static Offset<double> YV = new Offset<double>(0x30A0);

        public static Offset<double> PitchVel = new Offset<double>("PLC", 0x30A8); //ROTATION VELOCITY BODY X  Feet per second       //rads/sec
        public static Offset<double> RollVel = new Offset<double>("PLC", 0x30B0);//ROTATION VELOCITY BODY Y 
        public static Offset<double> YawVel = new Offset<double>("PLC", 0x30B8);//ROTATION VELOCITY BODY Z 

        public static Offset<int> Pitch_A = new Offset<int>("map",0x0578,false);   //PLANE PITCH DEGREES     Radians        //*360/(65536*65536)   dgree    下加上减  左加右减
        public static Offset<int> Bank_A = new Offset<int>("map",0x057C,false);//PLANE BANK DEGREES      Radians 
        public static Offset<int> Heading_A = new Offset<int>("map",0x0580,false);//PLANE HEADING DEGREES TRUE    Radians

        public static Offset<short> OnGround = new Offset<short>("map",0x0366,false);           //0 air 1 ground


        public static double Pitch_;
        public static double Bank_;
        public static double Heading_;

        public static double PitchA;
        public static double BankA;
        public static double YawA;

        public static double XA;
        public static double YA;
        public static double ZA;

        public static double PitchV;
        public static double RollV;
        public static double YawV;

        public static int Flap;
        #endregion

        #region Simulator status
        static public Offset<short> PauseSim = new Offset<short>(0x0262);       //simulator pause setting
        public static Offset<short> SlewMode = new Offset<short>(0x05DC);
        #endregion

        #region PA-28 偏移量
        #region//杂项
        public static Offset<short> Hobss_Meter = new Offset<short>("Pa28_Read", 0x0898);//计时器，发动机大于2000转开始计数
        public static Offset<short> Hobss_Meter_tmp = new Offset<short>("Pa28_Read", 0x08C8);//用户计算发动机转速
        public static Offset<byte> Master_Warning = new Offset<byte>("Pa28_Read", 0x036C);//失速警告
        public static Offset<byte> Master_Caution = new Offset<byte>("Pa28_Read", 0x036D);//超速警告
        public static Offset<short> Fuel_Tank_Selector = new Offset<short>("Pa28_Write", 0x0AF8,true);//油箱选择OFF-L-R
        public static Offset<int> Autopilot_Switch = new Offset<int>("Pa28_Write", 0x07BC,true);//自动驾驶仪开关
        public static Offset<byte> Pitot_Heat = new Offset<byte>("Pa28_Write", 0x029C,true);//空速管加温
        public static Offset<short> pause = new Offset<short>("Pa28_Write", 0x0262, true);//冻结
        #endregion

        #region//顶部开关面板
        public static Offset<short> Engine_Starter = new Offset<short>("1", 0x0892);//发动机启动
        public static Offset<byte> Engine_Primer = new Offset<byte>(0x3100,true);//发动机启动注油器
        public static Offset<int> Master_Battery_Switch = new Offset<int>(0x3102);//主电池开关
        public static Offset<byte> Alternator = new Offset<byte>( 0x3101,true);//交流发电机开关
        public static Offset<int> Fuel_Pump = new Offset<int>( 0x3B98,true);//燃油泵开关
        public static Offset<short> Magneto = new Offset<short>(0x0892);//礠电机Prop: 0=Off, 1=right, 2=Left, 3=Both, 4=Star
        public static Offset<BitArray> Lights_Switch = new Offset<BitArray>( 0x0D0C, 2);//灯开关Landing、Nav、Strobe
        public static Offset<int> Avionics_Master = new Offset<int>( 0x2E80,true);//主要电子设备开关
        public static Offset<int> GearUpDown = new Offset<int>("1", 0x0BE8);//起落架
        #endregion

        #region//断路器面板
        public static Offset<byte> Avioncs_bus = new Offset<byte>("Pa28_Write", 0x3103,true);//    (0b6a0 is 0k,1 is fail)
        public static Offset<byte> ENG_Start_Break = new Offset<byte>("Pa28_Write", 0x0B6B,true);//0 is 0k,1 is fail
        public static Offset<byte> Altr = new Offset<byte>("1", 0x3101);//1 is ok,0is fail
        public static Offset<byte> Pitot_Heat_Break = new Offset<byte>("Pa28_Write", 0x3BE3,true);//0 is ok,1is fail
        public static Offset<byte> GEA = new Offset<byte>("", 0x3B7C);//1 is ok,0 is fail
        public static Offset<int> PFD = new Offset<int>("Pa28_Write", 0x281C,true);//1 is ok,0 is fail
        public static Offset<byte> COM1 = new Offset<byte>("Pa28_Write", 0x0B68,true);//0 is ok,1 is fail 
        public static Offset<byte> AHRS = new Offset<byte>("Pa28_Write", 0x0B6D,true);//0 OK，1 fail 航向参考系统
        public static Offset<byte> AUDIO_MKR = new Offset<byte>("Pa28_Write", 0x0B68,true);//0 ok,1 fail
        public static Offset<byte> XPDR = new Offset<byte>("Pa28_Write", 0x0B6F,true);//0 ok,1 fail 应答机
        public static Offset<byte> Fuel_Pump_Break = new Offset<byte>("Pa28_Write", 0x3104,true);//1 ok,0 fail
        public static Offset<byte> MFD = new Offset<byte>("Pa28_Write", 0x2E80,true);//1 ok,0 fail
        public static Offset<byte> COM2 = new Offset<byte>("Pa28_Write", 0x0B68,true);//0 ok,1 fail
        public static Offset<byte> ADF_Break = new Offset<byte>("Pa28_Write", 0x0B64,true);//0 ok,1 fail

        #endregion

        #region//ADF面板
        //public static Offset<short> ADF_Frequency = new Offset<short>("Pa28_Write", 0x034C);//ADF频率 写
        //public static Offset<short> ADF_Standby_Frequency = new Offset<short>("Pa28_Write", 0x0284);//ADF备用频率 写
        //public static Offset<short> ADF_Frequency_r = new Offset<short>("Pa28_Read", 0x034C);//ADF频率 读
        //public static Offset<short> ADF_Standby_Frequency_r = new Offset<short>("Pa28_Read", 0x0284);//ADF备用频率 读
        public static Offset<short> Pa28Throttle = new Offset<short>("Pa28_Write", 0x088C, true);//油门杆
        public static Offset<short> Pa28Mixture = new Offset<short>("Pa28_Write", 0x0890, true);//混合比杆
        public static Offset<short> Elevator_Trim = new Offset<short>("Pa28_Write", 0x0BC0, true);//上下配平轮上正下负
        public static Offset<short> Rudder_Trim = new Offset<short>("Pa28_Write", 0x0C04, true);//左右配平左负右正
        public static Offset<int> tFlap = new Offset<int>("Pa28_Write", 0x0BDC, true);//襟翼
        public static Offset<short> Parking_Brake_w = new Offset<short>("Pa28_Write", 0x0BC8,true);//停车制动器写入
        public static Offset<short> Carb_heat = new Offset<short>("Pa28_Write", 0x08B2,true);//化油器热控制
        #endregion

        #region//操作面板
        public static Offset<short> Propeller_Control = new Offset<short>("1", 0x088E);//螺旋桨控制
        public static Offset<short> Rudder_Axis = new Offset<short>("Pa28_Write", 0x0BBA,true);//脚蹬方向舵 左负右正
        public static Offset<short> Left_Brake = new Offset<short>("Pa28_Write", 0x0BC4,true);//左刹车
        public static Offset<short> Right_Brake = new Offset<short>("Pa28_Write", 0x0BC6,true);//右刹车
        //public static Offset<short> Elevator_Axis = new Offset<short>("Pa28_Write", 0x0BB2,true);//操作杆俯仰 仰正俯负
        //public static Offset<short> Aileron_Axis = new Offset<short>("Pa28_Write", 0x0BB6,true);//操作杆翻滚 左负右正
        #endregion
        #endregion

        #region R22偏移量
        #region//六孔仪表板
        //六孔仪表面板
        public static Offset<byte> CLUTCH_LIGHT = new Offset<byte>("R22_read", 0x081F);//离合灯
        public static Offset<double> MR_TEMP = new Offset<double>("R22_read", 0x0828);//转子传输温度灯
        public static Offset<int> STARTER_on = new Offset<int>("R22_read", 0x3B00);
        public static Offset<int> LOW_MAINFUEL_LIGHT = new Offset<int>("R22_read", 0x0B74);//燃料不足灯
        public static Offset<int> LOW_PRM_LIGHT = new Offset<int>("R22_read", 0x0908);//低转速灯
        public static Offset<byte> ALTERNATOR = new Offset<byte>("R22_read", 0x3101);//Alternator发动机
        public static Offset<double> OIL_PRESSURE_LIGHT = new Offset<double>("R22_read", 0x3B60);//低油压灯
        public static Offset<byte> GOV_OFF_LIGHT = new Offset<byte>("R22_read", 0x0821);//调速器灯
        public static Offset<int> VERTICAL_SPEED = new Offset<int>("R22_read1", 0x02C8);//垂直速度表
        /// <summary>
        /// R22 空速表数据
        /// </summary>
        /// 

        public static Offset<int> _AIRSPEED = new Offset<int>("R22_read1", 0x02BC);//空速表
        public static Offset<int> ROTOR_RPM = new Offset<int>("R22_read1", 0x0908);//转子转速
        public static Offset<UInt16> ENGING_RPM = new Offset<UInt16>("R22_read1", 0x0896);//发动机转速
        public static Offset<double> Whiskey_Compass = new Offset<double>("R22_read1", 0x02CC);//磁罗盘
        public static Offset<int> PITCH = new Offset<int>("R22_read1", 0x0578);//俯仰
        public static Offset<int> BANK = new Offset<int>("R22_read1", 0x057C);//翻滚
                                                                              /// <summary>
                                                                              /// R22 高度表数据
                                                                              /// </summary>
        public static Offset<int> pres_ALTIMETER = new Offset<int>("R22_read1", 0x3324);//气压高度表，用于高度表示数
        public static Offset<short> pres_knot = new Offset<short>("", 0x0330);//气压值，用于高度表上的旋钮

        public static Offset<int> _ALTIMETER = new Offset<int>("R22_read1", 0x0574);//高度表
        public static Offset<short> MANIFOLD_PRESSURE_GAGE = new Offset<short>("R22_read1", 0x08C0);//发动机歧管压力表
        public static Offset<short> FULL_THROTTLE_LIGHT = new Offset<short>("R22_read", 0x332e);//油门信息灯
        public static Offset<byte> BREAK_LIGHT = new Offset<byte>("R22_read", 0x081E);//转子制动灯

        public static Offset<byte> CLUCH_SWITCH = new Offset<byte>("R22_write", 0x0889);//离合器开关
        public static byte Cluch_Switch = 1;//离合器开关
        public static Offset<short> IGNITION_SWITCH = new Offset<short>("R22_write", 0x0892);//五挡钥匙开关

        public static Offset<short> Throttle_Axis = new Offset<short>("R22_read1", 0x332e);//总距读取
        #endregion

        #region 燃油发动机面板
        public static Offset<double> CARBURETOR_AIR_TEMP = new Offset<double>("R22_read", 0x3828);//化油器温度表
        public static Offset<double> AMMETER = new Offset<double>("R22_read", 0x2888);//电表
        public static Offset<UInt16> OIL_PRESS = new Offset<UInt16>("R22_read", 0x08BA);//油压表
        public static Offset<int> AUX_FUEL_LEVEL = new Offset<int>("R22_read", 0x0B94);//辅助燃油量百分比
        public static Offset<short> OIL_TEMP = new Offset<short>("R22_read", 0x08B8);//燃油温度表

        public static Offset<int> MAIN_FUEL_LEVEL = new Offset<int>("R22_read", 0x0B74);//主燃油量百分比

        public static Offset<short> CYL_HD_TEMP = new Offset<short>("R22_read", 0x08BE); //汽缸盖温度CYL_HD_TEMP
        #endregion

        #region 音频面板
        public static Offset<BitArray> NAV_STROBE__LTS = new Offset<BitArray>("R22_write", 0x0D0C, 2);//航行灯，频闪灯
        public static Offset<byte> AVIONICS = new Offset<byte>("R22_write", 0x3103);//电子开关
        public static Offset<int> ALTERNATOR_SWITCH_w = new Offset<int>("R22_write", 0x3B78);//发动机开关 写
        public static Offset<int> ALTERNATOR_SWITCH_r = new Offset<int>("R22_read1", 0x3B78);//发动机开关 读
        public static Offset<byte> BATERY_SWITCH_w = new Offset<byte>("R22_write", 0x281C);//电池开关 写
        public static Offset<byte> BATERY_SWITCH_r = new Offset<byte>("R22_read1", 0x281C);//电池开关 读
        public static Offset<BitArray> Radio_audio_switches = new Offset<BitArray>("R22_write", 0x3122, 1);//无线电音频面板开关
        public static Offset<short> COM1_Frequency = new Offset<short>(0x034E);//COM1频率
        public static Offset<short> COM1_Standby_Frequency = new Offset<short>("R22_read1", 0x311A);//COM1备用频率
        public static Offset<short> NAV1_Frequency = new Offset<short>(0x0350);//NAV1频率
        public static Offset<short> NAV1_Standby_Frequency = new Offset<short>("R22_read1", 0x311E);//NAV1备用频率
        public static Offset<short> Inner_Marker = new Offset<short>("R22_read", 0x0BAC);//Inner Marker: activated when TRUE
        public static Offset<short> Middle_Marker = new Offset<short>("R22_read", 0x0BAC);//Middle Marker: activated when TRUE
        public static Offset<short> Outer_Marker = new Offset<short>("R22_read", 0x0BAC);//Outer Marker: activated when TRUE
        public static Offset<byte> COM1_STBY_SWAP = new Offset<byte>("R22_write", 0x3123);//COM1备用频率切换 NAV1备用频率切换   
        public static Offset<short> Transponder_w = new Offset<short>("R22_write", 0x0354);//发送应答显示 写
        public static Offset<short> Transponder_r = new Offset<short>("R22_read1", 0x0354);//发送应答显示 读                                      

        #endregion

        #region 操作杆面板
        public static Offset<byte> ELT_SWITCH = new Offset<byte>("R22_write", 0x341D);//ELT开关
        public static Offset<short> Rotor_Trim = new Offset<short>("R22_write", 0x0824);//转子调整
        public static Offset<short> MIXTURE = new Offset<short>("R22_write", 0x0890);//混合比杆
        public static Offset<byte> Rotor_GOV_Switch = new Offset<byte>("R22_write", 0x0826);//转子调速开关
        #endregion

        #region 断路器
        public static Offset<byte> ALT_Break = new Offset<byte>("R22_write", 0x3101);//1ok,0fail
        public static Offset<byte> CLUTCH_START = new Offset<byte>("R22_write", 0x0889);//1ok,0fail
        public static Offset<byte> GAERS = new Offset<byte>("R22_write", 0x0B73);//0ok,1fail
        public static Offset<byte> ADF_TURN = new Offset<byte>("R22_write", 0x0B64);//0ok,1fail
        public static Offset<byte> GYRO_HORIZ = new Offset<byte>("R22_write", 0x0B69);//0ok,1fail
        public static Offset<byte> AVIONICS_FAN = new Offset<byte>("R22_write", 0x3103);//0ok,1fail
        public static Offset<byte> XPDR_ADS = new Offset<byte>("R22_write", 0x0B6F);//0ok,1fail
        public static Offset<byte> COM2_Break = new Offset<byte>("R22_write", 0x0B68);//0ok,1fail
        public static Offset<byte> COM1_Break = new Offset<byte>("R22_write", 0x0B68);//0ok,1fail
        public static Offset<byte> HEATER = new Offset<byte>("R22_write", 0x3BE3);//0ok,1fail

        public static Offset<int> FUEL_VALUE = new Offset<int>("R22_write", 0x3590);//油路开关 0-close 1-open 规划在断路器面板上
        #endregion


        #endregion
    }
}
